﻿namespace TestTool.Proxies.Event
{
    using System;
    using System.CodeDom.Compiler;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.Xml;

    [DebuggerStepThrough, GeneratedCode("System.ServiceModel", "3.0.0.0")]
    public class PullPointSubscriptionClient : ClientBase<PullPointSubscription>, PullPointSubscription
    {
        public PullPointSubscriptionClient()
        {
        }

        public PullPointSubscriptionClient(string endpointConfigurationName) : base(endpointConfigurationName)
        {
        }

        public PullPointSubscriptionClient(Binding binding, EndpointAddress remoteAddress) : base(binding, remoteAddress)
        {
        }

        public PullPointSubscriptionClient(string endpointConfigurationName, EndpointAddress remoteAddress) : base(endpointConfigurationName, remoteAddress)
        {
        }

        public PullPointSubscriptionClient(string endpointConfigurationName, string remoteAddress) : base(endpointConfigurationName, remoteAddress)
        {
        }

        public DateTime PullMessages(string Timeout, int MessageLimit, XmlElement[] Any, out DateTime TerminationTime, out NotificationMessageHolderType[] NotificationMessage)
        {
            PullMessagesRequest request = new PullMessagesRequest {
                Timeout = Timeout,
                MessageLimit = MessageLimit,
                Any = Any
            };
            PullMessagesResponse response = ((PullPointSubscription) this).PullMessages(request);
            TerminationTime = response.TerminationTime;
            NotificationMessage = response.NotificationMessage;
            return response.CurrentTime;
        }

        public void SetSynchronizationPoint()
        {
            base.Channel.SetSynchronizationPoint();
        }

        [EditorBrowsable(EditorBrowsableState.Advanced)]
        PullMessagesResponse PullPointSubscription.PullMessages(PullMessagesRequest request)
        {
            return base.Channel.PullMessages(request);
        }
    }
}

